package com.example.jpatest.repository;

import com.example.jpatest.entity.Competition;
import com.example.jpatest.entity.Enter;
import com.example.jpatest.entity.Team;
import org.springframework.data.jpa.repository.JpaRepository;

import java.util.Optional;

/**
 * @author czx
 */
public interface EnterRepository extends JpaRepository<Enter,Long> {
    /**
     * 根据竞赛和队伍查找
     */
    Optional<Enter> findByCompetitionAndTeam(Competition competition, Team team);

    /**
     * 根据竞赛和队伍删除
     */
    void deleteByTeamAndCompetition(Team team,Competition competition);
}
